package javaconfig;
// 使用javaconfig配置bean，不需要给bean带上帽子
public class UserService {

    private UserDao userDao;

    public UserService(){
        System.out.println("UserService 被实例化了。。。。。。。。。。。");
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public boolean isExists(int userId){
        boolean flag=false;
        String userName=userDao.selectUsername(userId);
        if(userName!=null&&!"".equals(userName)){
            flag=true;
        }
        return flag;
    }
}
